package com.hsnn.medstgmini.settlement.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hsnn.medstgmini.Constants;
import com.hsnn.medstgmini.settlement.model.form.BankAcctLog;
import com.hsnn.medstgmini.settlement.service.BankAcctInfoManager;
import com.hsnn.medstgmini.sys.model.SysUser;
import com.hsnn.medstgmini.util.Pagination;

@Controller
@RequestMapping("/bankAcctInfoLog")
public class AcctInfoBankLogController {
	
	private static final Logger log = Logger
			.getLogger(AcctInfoBankLogController.class);
	
	@Autowired
	private BankAcctInfoManager bankAcctInfoManager;

	@Autowired
	private HttpServletRequest request;
	
	@Autowired
	private HttpSession session;

	/**
	 * 
	 *@category  获取当前人登录信息
	 *@author 言科
	 *@date 2015年7月23日
	 *SysUser
	 */
	public SysUser getUser() {
		return (SysUser) session.getAttribute(Constants.USERINFO);
	}
	
	/**
	 * 
	 *@category  跳转到日志页面
	 *@author 言科
	 *@date 2015年7月23日
	 *String
	 */
	@RequestMapping("/toBankAcctInfoLog")
	public String toBankAcctInfoLog(Model model,String bankAcctId){
		model.addAttribute("bankAcctId", bankAcctId);
		return "/settle/bankAcctInfoLog";
	}
	
	
	@RequestMapping("/getBankAcctInfoLog")
	@ResponseBody
	public Pagination getBankAcctInfoLog(BankAcctLog bankAcctLog) {
		Pagination page = new Pagination(request);
		return bankAcctInfoManager.getBankAcctLogList(bankAcctLog, page);
		
	}
	
	
	/**
	 * 
	 *@category  中心端 跳转到日志页面
	 *@author 言科
	 *@date 2015年7月23日
	 *String
	 */
	@RequestMapping("/toBankAcctInfoLogCore")
	public String toBankAcctInfoLogCore(Model model,String bankAcctId){
		model.addAttribute("bankAcctId", bankAcctId);
		return "/settle/bankAcctInfoLogCore";
	}
	
	
	@RequestMapping("/getBankAcctInfoLogCore")
	@ResponseBody
	public Pagination getBankAcctInfoLogCore(BankAcctLog bankAcctLog) {
		Pagination page = new Pagination(request);
		return bankAcctInfoManager.getBankAcctLogList(bankAcctLog, page);
		
	}
	

}
